-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Document predefined compiler symbols in F# compiler directives #49386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: BillWagner <[email protected]>
Co-authored-by: BillWagner <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive documentation for predefined compiler symbols in F# compiler directives, addressing a documentation gap where users were unclear about automatically defined symbols like DEBUG.
Key Changes:
- Added a new "Predefined symbols" section documenting build configuration symbols (
DEBUG,TRACE), compilation mode symbols (COMPILED,INTERACTIVE), and target framework symbols - Included practical code examples showing how to use these symbols in conditional compilation
- Added cross-references to related documentation (Assertions, F# Interactive, compiler options)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, and is ready for final review.
Fixes #[issue_number]
This PR addresses the missing documentation for predefined compiler symbols that the F# compiler and build system automatically define. Users were unclear about which symbols (like
DEBUG) are automatically available for conditional compilation.Changes
Added a comprehensive "Predefined symbols" section to the F# compiler directives documentation that covers:
Build configuration symbols
DEBUG: Automatically defined in Debug builds, used with assertions and diagnostic codeTRACE: Defined for builds with tracing enabledCompilation mode symbols
COMPILED: Defined when compiling with the F# compilerINTERACTIVE: Defined when running in F# Interactive (dotnet fsi)Target framework symbols
NET6_0_OR_GREATER,NETSTANDARD2_0, etc.) via the existingpreprocessor-symbols.mdinclude fileThe documentation includes practical examples and cross-references to related topics (Assertions, F# Interactive, and compiler options). This brings the F# documentation in line with the C# preprocessor directives documentation structure.
Related
Original prompt
Fixes #45478
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Internal previews